import React, {Component} from 'react'
import {Platform, StyleSheet, Text, View, Image, TouchableOpacity, ScrollView} from 'react-native'
import MinaIcon from '../../components/MinaIcon.js'
import CurChildren from '../../components/CurChildren.js'
import NavigationBar from '../../components/NavigationBar.js'
import MinaStyle from '../../assets/css/commonStyle.js'
import HomeNavComponent from './homeNav/HomeNavComponent.js'
import LatestActivityComponent from './latestActivity/LatestActivityComponent.js'
import ClassInteractionComponent from './classInteraction/ClassInteractionComponent.js'
import PointsExchangeComponent from './pointsExchange/PointsExchangeComponent.js'
import actions from "../../redux/action";
import {connect} from "react-redux";

type Props = {};
export default class Home extends Component<Props> {
  renderNavigationBar(){
    let statusBar = {
      backgroundColor: '#ccc',
      barStyle: 'light-content',
      translucent: true,
    }
    let navigationBar = <NavigationBar
      title = {''}
      statusBar = {statusBar}
      leftText = {'MINAKEVIN'}
      leftStyle = {{color: '#333333', fontSize: 18, fontWeight: ('normal', '600')}}
      rightText = {'海印又一城'}
      rightStyle = {{color: '#282828', fontSize: 16, fontWeight:('normal', '400')}}
      style={{backgroundColor: '#fff'}}
    />;
    return navigationBar;
  }
  render() {
    let curChildren = <CurChildren page = {'Home'}/>
    return (
      <View style={MinaStyle.minaContainer}>
        {this.renderNavigationBar()}
        <ScrollView>
          {curChildren}
          <View style={MinaStyle.minaMain}>
            <HomeNavComponent/>
            <LatestActivityComponent/>
            <ClassInteractionComponent/>
            <PointsExchangeComponent/>
          </View>
        </ScrollView>
      </View>
    );
  }
}
// const mapStateToProps = state => ({
//   home: state.home,
// });
// const mapDispatchToProps = dispatch => ({
//   fetchClassInteractions: (params) => dispatch(actions.fetchClassInteractions(params))
// });
// export default connect(mapStateToProps, mapDispatchToProps)(Home);
const styles = StyleSheet.create({

});